﻿<UserControl x:Class="SosaAnalysisModule.ImageComposer"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      xmlns:wpfx="clr-namespace:Xceed.Wpf.Toolkit;assembly=WPFToolkit.Extended"
      mc:Ignorable="d" 
      d:DesignHeight="311" d:DesignWidth="503" >

    <UserControl.Resources>
        <Storyboard x:Key="backMouseEnter">
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="backTextBlock" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
                <SplineDoubleKeyFrame KeyTime="00:00:00.2000000" Value="1.2"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="backTextBlock" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)">
                <SplineDoubleKeyFrame KeyTime="00:00:00.2000000" Value="1.2"/>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Key="backMouseLeave">
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="backTextBlock" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1.2"/>
                <SplineDoubleKeyFrame KeyTime="00:00:00.2000000" Value="1"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="backTextBlock" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)">
                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1.2"/>
                <SplineDoubleKeyFrame KeyTime="00:00:00.2000000" Value="1"/>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
    </UserControl.Resources>

    <UserControl.Triggers>
        <EventTrigger RoutedEvent="Mouse.MouseEnter" SourceName="backTextBlock">
            <BeginStoryboard x:Name="backMouseEnter_BeginStoryboard" Storyboard="{StaticResource backMouseEnter}"/>
        </EventTrigger>
        <EventTrigger RoutedEvent="Mouse.MouseLeave" SourceName="backTextBlock">
            <BeginStoryboard x:Name="backMouseLeave_BeginStoryboard" Storyboard="{StaticResource backMouseLeave}"/>
        </EventTrigger>
    </UserControl.Triggers>
    
    <Grid>
        <TextBox Height="27" HorizontalAlignment="Left" Margin="36,59,0,0" Name="folderpathBox" VerticalAlignment="Top" Width="319" TextChanged="searchDirectoryChanged" />
        <Button Content="Choose Folder" Height="28" HorizontalAlignment="Right" Margin="0,59,36,0" Name="button2" VerticalAlignment="Top" Width="106" FontSize="14" Click="chooseFolder" />
        <Button Content="Create Image" Height="31" Margin="296,279,36,0" Name="createImageButton" VerticalAlignment="Top" FontSize="16" Click="createImage" />

        <ListView Name="GroupList"
           SelectionMode="Single" Margin="36,92,36,84">
            <ListView.View>
                <GridView>
                    <GridViewColumn Header="Group Name" Width="110">
                        <GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <TextBox Height="23" HorizontalAlignment="Left" Width="110" Text="{Binding Name}"/>
                            </DataTemplate>
                        </GridViewColumn.CellTemplate>
                    </GridViewColumn>
                    <GridViewColumn Header="Color" Width="133">
                        <GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <wpfx:ColorPicker Height="30" DisplayColorAndName="True" Width="120" SelectedColor="{Binding color}"/>
                            </DataTemplate>
                        </GridViewColumn.CellTemplate>
                    </GridViewColumn>
                    <GridViewColumn Header="Filter" Width="110">
                        <GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <TextBox Height="23" HorizontalAlignment="Left" Width="110" Text="{Binding Id}"/>
                            </DataTemplate>
                        </GridViewColumn.CellTemplate>
                    </GridViewColumn>
                    <GridViewColumn Header="" Width="85">
                        <GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <Button Height="23" HorizontalAlignment="Left" Width="68" Content="Trash" Click="removeGroup" />
                            </DataTemplate>
                        </GridViewColumn.CellTemplate>
                    </GridViewColumn>
                </GridView>
            </ListView.View>
        </ListView>
        <Button Content="Add New Group" Height="29" Name="addGroupButton" Click="addNewGroup" FontSize="16" Margin="36,239,37,43" />

        <TextBlock x:Name="backTextBlock" HorizontalAlignment="Center" Margin="20,19,423,0" VerticalAlignment="Top" Text="Back" FontSize="16" Width="60" Height="25" TextAlignment="Right" RenderTransformOrigin="0.5,0.5" MouseLeftButtonDown="back_MouseLeftButtonDown">
			<TextBlock.RenderTransform>
				<TransformGroup>
					<ScaleTransform/>
					<SkewTransform/>
					<RotateTransform/>
					<TranslateTransform/>
				</TransformGroup>
			</TextBlock.RenderTransform>
        </TextBlock>
        <Label Content="Image Composer" FontSize="18" Height="38" HorizontalAlignment="Center" Margin="324,0,12,261" Name="label1" VerticalAlignment="Bottom" Width="167" />
    </Grid>

</UserControl>
